#ifndef __CONFIG_FACTORY_H__
#define __CONFIG_FACTORY_H__

#include "cJSON.h"

#define JSON_FACTORY_CRC32 "factory_crc32"
#define JSON_FACTORY_LEN "factory_len"
#define JSON_FACTORY_DATA "factory_data"

#define FACTORY_NODE "factory"
#define STATE_NODE_CFG "state"
#define REMARK_NODE_CFG "remark"

#define NAME_LEN 8
#define REMARK_LEN 32

typedef struct
{
    // 模块名字
    char name[NAME_LEN];
    // 状态,
    int state;
    // 备注
    char remark[REMARK_LEN];
} factory_test_t;

int add_test_cfg(cJSON *data_json, factory_test_t *config);

int uc_write_factory_data(factory_test_t *config, int num);

int uc_read_factory_data(factory_test_t *static_data, int num);

#endif